<?php
    require("./Utils.php");

    $post = getJsonParamter();

    $username = $post['username'];
    $id = $post['id'];
    $number = $post['number'];

    $conn = getConnection();
    $sql = "UPDATE cart SET number = ? WHERE user_id = ? AND id = ?";

    $result = execute($conn, $sql, $number, $username, $id);

    if($result) getJson(200, '修改成功', null);

    else getJson(500, '修改失败', null);
?>